package uk.ac.lkl.lpp.ui;

import junit.framework.TestCase;

public class BackCompatTest extends TestCase {

	public void testIsOldForm() {
		if (BackCompat.isOldForm("ac.uk.lkl.bamba")) fail("expected false");
		if (!BackCompat.isOldForm("lpp.bisli")) fail("expected true");
		if (!BackCompat.isOldForm("general.tapuchips")) fail("expected true");
		
	}

	public void testUpgrade() {
		if (!BackCompat.upgrade("ac.uk.lkl.milki").equals("ac.uk.lkl.milki")) fail("expected equal");
		String tmp = BackCompat.upgrade("lpp.milki"); 
		if (!tmp.equals("uk.ac.lkl.lpp.milki")) fail("expected upgrade, got "+tmp);
		tmp = BackCompat.upgrade("general.milki");
		if (!tmp.equals("uk.ac.lkl.common.milki")) fail("expected upgrade, got "+tmp);
		
	}

}
